package org.springframework.core.annotation;

import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;

public interface MergedAnnotations {

    <A extends Annotation> MergedAnnotation<A> get(Class<A> annotationType);

    static MergedAnnotations from(AnnotatedElement annotatedElement,
                                  SearchStrategy searchStrategy) {

        return new TypeMappedAnnotations(annotatedElement, searchStrategy, AnnotationFilter.PLAIN);
    }

    enum SearchStrategy {
        DIRECT, INHERITED_ANNOTATIONS, SUPERCLASS, TYPE_HIERARCHY
    }
}
